package 第二章练习;
import java.io.*;
public class lianxi80 {
    public static void main(String[] args) throws Exception {
        StringBuffer buffer = new StringBuffer();
        File file = new File("D:" + File.separator + "Demo01" + File.separator + "lianxi77.java");
        if (file.exists()){
            try (InputStream input = new FileInputStream(file)){
                byte data[] = new byte[8];
                int len = 0;
                while ((len = input.read(data)) != -1) {
                    buffer.append(new String(data, 0, len));
            }
                System.out.println("读取到的内容【" + buffer + "】");
            } catch (Exception e) {}
        }
    }
}
